<?php
/**
 * 发送短信的基类
 */
namespace app\common\lib;
class Sms{
	
	public static function sendSms($phone,$code){
		$url='http://sms.exintong.net:9038';//系统接口地址
		$content=urlencode("【超宝验证】您的验证码是:".$rand.",5分钟后过期，请您及时验证!");
		$username="xiao123";//用户名
		$password="MTIzNDU2";//密码百度BASE64加密后密文
		$url=$url."/servlet/UserServiceAPI?method=sendSMS&extenno=&isLongSms=0&username=".$username."&password=".$password."&smstype=2&mobile=".$phone."&content=".$content;
		$html = file_get_contents($url);
		if(!strpos($html,"success")){
		 	return true;
		}else{
			return false;	
		}
	}

}

